import Foundation
import Dispatch

/// Execute closure on main thread, synchronously
public func onMain(_ closure: () -> ()) {
    if Thread.isMainThread {
        closure()
    } else {
        DispatchQueue.main.sync(execute: closure)
    }
}

//            //1:动态获取命名空间
//            guard   let name = Bundle.main.infoDictionary!["CFBundleExecutable"] as? String else {
////                mymsg(message: "获取命名空间失败")
//                return
//            }
//
//            let cls: Any? = NSClassFromString(name + "." + "responseModel") //VCName:表示试图控制器的类名
//
//            // Swift中如果想通过一个Class来创建一个对象, 必须告诉系统这个Class的确切类型
//            guard let typeClass: = cls as? responseModel.Type else {
////                SHLog(message: "cls不能当做UIViewController")
//                return
//            }
////            print(typeClass)
////
//            let childController = typeClass.init()

//
